import os, sys, time
from glob import glob

env = Environment()
if ARGUMENTS.get('release', '0') == '0':
    env.Append(CPPFLAGS = ['-O0', '-g3', '-Werror', '-std=gnu++11'])
else:
    env.Append(CPPFLAGS = ['-O3', '-g0', '-Wall', '-std=gnu++11'])
env.Append(CPPPATH = ['../', '/usr/local/include'])
env.Append(CPPDEFINES={'_FILE_OFFSET_BITS' : '64', 
'DEBUG' : 1, 
})
env.Append(LIBPATH = ['/usr/local/lib', '../lib/linux/debug',])
env.Append(LIBS=['nsl', 'pthread', 'dl', 'glog', 'tcmalloc', 'protobuf', 'gflags', 'rt'])

source_files = glob('../rpc/module/*.cc') + \
               glob('../rpc/*.cc') + \
               glob('../base/*.cc') + \
               glob('../util/*.cc') + glob('../*.cc')

print("souce code list: >>")
for s in source_files:
	print(os.path.realpath(s))
print('')

env.Program('nfs', source_files)
